package com.jp.knowledge.my.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.jp.knowledge.R;
import com.jp.knowledge.activity.BaseFragment;
import com.jp.knowledge.my.view.RoundRectView;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.ViewInject;
import org.xutils.x;

/**
 * 电脑端导入，选项卡
 *
 * @author gzejia 978862664@qq.com
 */
@ContentView(R.layout.fragment_pc_import)
public class PcImportFragment extends BaseFragment {

    /**
     * 引导第一步
     */
    public static final int GUIDE_NUMBER_FIRST = 0;
    /**
     * 引导第二步
     */
    public static final int GUIDE_NUMBER_SECOND = 1;
    /**
     * 引导第三步
     */
    public static final int GUIDE_NUMBER_THIRD = 2;

    @ViewInject(R.id.pc_import_v_number)
    private RoundRectView mNumberTv;

    @ViewInject(R.id.pc_import_tv_title)
    private TextView mTitleTv;

    @ViewInject(R.id.pc_import_tv_hide)
    private TextView mHideTv;

    @ViewInject(R.id.pc_import_iv)
    private ImageView mImage;

    public int mGuideNumber = GUIDE_NUMBER_FIRST;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
                             @Nullable Bundle savedInstanceState) {
        return x.view().inject(this, inflater, container);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        initData();
    }

    private void initData() {
        switch (mGuideNumber) {
            case GUIDE_NUMBER_FIRST:
                mNumberTv.setText(String.valueOf(1));
                mTitleTv.setText(R.string.pc_import_tv_first);
                mHideTv.setText(R.string.pc_import_tv_first_hide);
                mImage.setImageResource(R.mipmap.cgsays_logo);
                break;
            case GUIDE_NUMBER_SECOND:
                mNumberTv.setText(String.valueOf(2));
                mTitleTv.setText(R.string.pc_import_tv_second);
                mHideTv.setText(R.string.pc_import_tv_second_hide);
                mImage.setImageResource(R.mipmap.cgsays_logo);
                break;
            case GUIDE_NUMBER_THIRD:
                mNumberTv.setText(String.valueOf(3));
                mTitleTv.setText(R.string.pc_import_tv_third);
                mHideTv.setText(R.string.pc_import_tv_third_hide);
                mImage.setImageResource(R.mipmap.cgsays_logo);
                break;
        }
    }
}
